﻿using System.Windows;
using Safover.LidarCollector.ViewModel;

namespace Safover.LidarCollector.View
{
    /// <summary>
    /// Interaction logic for CameraWindow.xaml
    /// </summary>
    public partial class CameraWindow : Window
    {
        //public ImageWindow ImageWindow { get; set; } = new ImageWindow();

        public CameraWindow()
        {
            InitializeComponent();

            DataContext = new CameraPageViewModel()
            {
                PlayWnd = Video_PBX_01.Handle
            };
        }



        private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            (DataContext as CameraPageViewModel).StopVideoCommand.Execute(null);

            e.Cancel = true;

            Visibility = Visibility.Hidden;
        }

        private void ShowImage(object sender, RoutedEventArgs e)
        {
            ImageWindow window = new ImageWindow((DataContext as CameraPageViewModel).CurrentImagePath)
            {
                Owner = this
            };

            window.Show();
        }
    }
}
